//
//  DBPictureViewController.m
//  PictureCircle
//
//  Created by Apple on 14-9-18.
//  Copyright (c) 2014年 Apple. All rights reserved.
//

#import "DBPictureViewController.h"
#import "DBPackageCircleView.h"
#import "AFNetworking.h"


@interface DBPictureViewController ()

@property (strong, nonatomic) IBOutlet UIView *picCircleView;

@end

@implementation DBPictureViewController

#define kPicScrollUrlString @"http://apis.36kr.com/api/v1/topics/feature.json?token=734dca654f1689f727cc:32710&platform=android&version=1.0.5"

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
    [manager GET:kPicScrollUrlString parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        DBPackageCircleView * packageView = [[DBPackageCircleView alloc] initWithFrame:CGRectMake(0, 0, 320, 200) array:responseObject];
        [self.picCircleView addSubview:packageView];
        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error:%@", error);
    }];
    
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
